export const practiceDataTemp = (obj) => {
  let result = "";

  //   if (obj.company) {
  //     result += "【公司名称】" + obj.company + "\n";
  //   }
  if (obj.companyInfo) {
    result += "【公司简介】" + obj.companyInfo + "\n";
  }
  if (obj.department) {
    result += "【实习部门】" + obj.department + "\n";
  }
  //   if (obj.station) {
  //     result += "【岗位】" + obj.station + "\n";
  //   }
  //   if (obj.salary) {
  //     result += "【薪资待遇】" + obj.salary + "\n";
  //   }
  if (obj.address) {
    result += "【工作地址】" + obj.address + "\n";
  }
  if (obj.work) {
    result += "【工作内容】" + obj.work + "\n";
  }
  if (obj.requirement) {
    result += "【实习要求】" + obj.requirement + "\n";
  }
  if (obj.obtained) {
    result += "【实习收获】" + obj.obtained + "\n";
  }
  if (obj.email) {
    result += "【邮箱】" + obj.email + "\n";
  }
  if (obj.emailFormat) {
    result += "【邮件主题及附件】" + obj.emailFormat + "\n";
  }
  if (obj.expire) {
    result += "【简历投递截止时间】" + timeFormat(obj.expire) + "\n";
  }
  if (obj.notes) {
    result += "【备注】" + obj.notes + "\n";
  }
  return result;
};
//把1684912675839时间转换为2023/1/1的格式
export const timeFormat = (val) => {
  const time = new Date(parseFloat(val));
  return time.toLocaleDateString();
};
//获取一周前的时间 返回是否在最近一周内
export const isWeekAgo = (val) => {
  let time = parseFloat(val);
  let ago = new Date().getTime() - 1000 * 60 * 60 * 24 * 7;
  return time >= ago;
};
